Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#8632: Support fp32 dest acc en in moreh_sum and moreh_sum_backward #8724

Merged
merged 8 commits into from
Jun 1, 2024

Conversation

dongjin-na
Copy link
Contributor

This PR adds the DeviceComputeKernelConfig parameter to operations like the moreh_sum and moreh_sum_backward functions. This change will allow us to provide kernel configuration settings optionally during function calls.

Tensor moreh_sum(
    const Tensor &input,
    std::vector<int64_t> &dims,
    const std::optional<const Tensor> output = std::nullopt,
    const MemoryConfig &output_mem_config = operation::DEFAULT_OUTPUT_MEMORY_CONFIG);
->
Tensor moreh_sum(
    const Tensor &input,
    std::vector<int64_t> &dims,
    const std::optional<const Tensor> output = std::nullopt,
    const MemoryConfig &output_mem_config = operation::DEFAULT_OUTPUT_MEMORY_CONFIG,
    std::optional<const DeviceComputeKernelConfig> compute_kernel_config = nullptr);
Tensor moreh_sum_backward(
    const Tensor &output_grad,
    const Tensor &input,
    std::vector<int64_t> &dims,
    const std::optional<const Tensor> input_grad = std::nullopt,
    const MemoryConfig &input_grad_mem_config = operation::DEFAULT_OUTPUT_MEMORY_CONFIG);
->
Tensor moreh_sum_backward(
    const Tensor &output_grad,
    const Tensor &input,
    std::vector<int64_t> &dims,
    const std::optional<const Tensor> input_grad = std::nullopt,
    const MemoryConfig &input_grad_mem_config = operation::DEFAULT_OUTPUT_MEMORY_CONFIG,
    std::optional<const DeviceComputeKernelConfig> compute_kernel_config = nullptr);

The only applied configurations in DeviceComputeKernelConfig are math fidelity and fp32_dest_acc_en.

@davorchap
Copy link
Collaborator

@tt-aho @TT-BrianLiu @mywoodstock please review/approve

@dongjin-na dongjin-na merged commit bfa47be into main Jun 1, 2024
5 checks passed
@dongjin-na dongjin-na deleted the 8632_sum_fp32 branch June 1, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
moreh moreh contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants